@inherits Umbraco.Web.Macros.PartialViewMacroPage

@*
    Macro Parameters To Create, for this macro to work:
    Alias:mediaId     Name:Media Folder ID    Type:Single Media Picker
*@

@if (Model.MacroParameters["mediaId"] != null)
{
     @* Get the media folder as a dynamic node *@
    var mediaFolder = Umbraco.Media(Model.MacroParameters["mediaId"]);
    
    if (mediaFolder.Children.Any())
    {
        <ul>
            @* for each item in children of the selected media folder *@
            @foreach (var mediaItem in mediaFolder.Children)
            {
                <li><img src="@mediaItem.umbracoFile" alt="@mediaItem.Name" /></li>
            }
        </ul>
    }
}